from django.shortcuts import render,redirect

# Create your views here.

from dj31.utils.QQLogin.QQLoginTool.QQtool import OAuthQQ
from django.views import View
from dj31.settings import settings


class QQAuthView(View):
    def get(self,request):
        state = request.META['HTTP_REFFRE'] #获取返回的值
        auth = OAuthQQ(
            client_id=settings.app_id,client_secret=settings.ak,redirect_uri=settings.red_url,state=state
        )
        login_url = auth.get_qq_url()
        print(login_url)

        return redirect(login_url)

from django.http import HttpResponse
def demo(request):
    HttpResponse('hello word')

auth_callback = demo






